# == Coding: UTF-8 ==
# @Project :        UItestPythonProject
# @fileName         personnelAdd_page.py  
# @version          v0.4
# @author           Echo
# @GiteeWarehouse   https://gitee.com/liu-long068/
# @editsession      2023/4/11
# @Software:        PyCharm
# ====/******/=====
from public.common.basepage import Page


class PersonnelAddPage(Page):
    def personnelAdd_page(self):
        self.dr.open('http://192.168.2.208/console/login')
        self.dr.send_key('id->username', '888')
        self.dr.send_key('id->password', 'Aa123456')
        self.dr.send_key('id->captcha', 'ABDS')
        self.dr.click('css->.ant-btn')
        self.dr.open('http://192.168.2.208/console/home')
        self.dr.click('css->.ant-card:nth-child(4) .home_auto_btn__LBhkK:nth-child(2)')
        self.dr.move_to_element("xpath->//span[contains(.,'业务审核')]")
        self.dr.click("link_text->业务指导(基层)")
        self.dr.click("link_text->00011111")
        self.dr.into_new_window()
        self.dr.move_to_element("xpath->//span[contains(.,'人员新增减少')]")
        self.dr.click("link_text->人员增加人员新增")
        self.dr.click('css->.ng-tns-c110-11 .ant-select-selection-search-input')
        self.dr.click('xpath->//nz-option-item[@title="专业技术人员"]')
        self.dr.clear_type('xpath->//input[@placeholder="请选择起薪时间"]', '202002')
        self.dr.send_key('xpath->//input[@placeholder="请输入姓名"]', '人员一')  # 输入姓名
        self.dr.click('xpath->//nz-select[@formcontrolname="gender"]')
        self.dr.click('xpath->//nz-option-item[@title="男"]')
        self.dr.click('xpath->//nz-select[@nzplaceholder="请选择民族"]')
        self.dr.click('xpath->//nz-option-item[@title="汉"]')
        self.dr.send_key('xpath->//input[@placeholder="请输入身份证号"]', '596811195710191492')
        self.dr.click('xpath->/html/body/app-root/smso-main/div/div/div/div/smso-add-staff/lib-staff-info/div/nz-tabset/div/div/div[1]/lib-personnel/div/div[1]/lib-person-info-basic/form/nz-form-item[5]/nz-form-control/div[1]/div/lib-date-input/div/nz-input-group/input')
        self.dr.click('xpath->//nz-select[@nzplaceholder="请选择政治面貌"]')
        self.dr.click('xpath->//nz-option-item[@title="群众"]')
        self.dr.click('xpath->//nz-select[@nzplaceholder="请选择人员来源"]')
        self.dr.click('xpath->//nz-option-item[@title="公招(高等院校毕业生)"]')
        self.dr.clear_type('xpath->//lib-date-input[@formcontrolname="joinDate"]/div/nz-input-group/input', '20080101')
        self.dr.click('xpath->//nz-tree-select[@nzplaceholder="请选择所属编制"]')
        self.dr.click('xpath->//nz-tree-node-title[@title="全额拨款事业编制"]')
        self.dr.clear_type('xpath->//lib-date-input[@formcontrolname="enterDate"]/div/nz-input-group/input', '20080101')
        self.dr.click('xpath->//nz-select[@nzplaceholder="请选择学历"]')
        self.dr.click('xpath->//nz-option-item[@title="大学本科毕业"]')
        self.dr.clear_type('xpath->//lib-date-input[@formcontrolname="graduateDate"]/div/nz-input-group/input', '20070630')
        self.dr.click('xpath->/html/body/app-root/smso-main/div/div/div/div/smso-add-staff/lib-staff-info/div/nz'
                      '-tabset/nz-tabs-nav/div[1]/div/div[2]/div')

